import Flutter
import UIKit
import Foundation

public class XbPlugin: NSObject, FlutterPlugin {
  public static func register(with registrar: FlutterPluginRegistrar) {
    let channel = FlutterMethodChannel(name: "xb_plugin", binaryMessenger: registrar.messenger())
    let instance = XbPlugin()
    registrar.addMethodCallDelegate(instance, channel: channel)
  }

  public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
    if (call.method == "getPlatformVersion") {
      result("iOS " + UIDevice.current.systemVersion)
    } else if (call.method == "getSystemLanguage") {
      result(Locale.current.languageCode)
    } else {
      result.notImplemented()
    }
  }
}
